/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package banco;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import transporte.TransporteBean;

/*
 * @author Alexander
 */

public class DaoCadastraTransporte {
    
    private Connection conexao;
    
    public DaoCadastraTransporte() throws SQLException{
        this.conexao = DaoConexao.getDaoConexao();
    }

    public void adiciona(TransporteBean transporte) throws SQLException{
        String sql = "INSERT INTO transporte (id, desc,placa,valor) VALUES(?,?,?,?)";

        PreparedStatement tpt = conexao.prepareStatement(sql);

        tpt.setString(1, transporte.getId());
        tpt.setString(2, transporte.getDescricao());
        tpt.setString(3, transporte.getPlaca());
        tpt.setString(4, transporte.getValor());
    }
}
